load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "opgen",
    srcs = [
        "op_funcs.go",
        "op_gen.go",
        "opgen_alias_type.go",
        "opgen_check_constraint.go",
        "opgen_check_constraint_unvalidated.go",
        "opgen_column.go",
        "opgen_column_comment.go",
        "opgen_column_compute_expression.go",
        "opgen_column_default_expression.go",
        "opgen_column_family.go",
        "opgen_column_name.go",
        "opgen_column_not_null.go",
        "opgen_column_on_update_expression.go",
        "opgen_column_type.go",
        "opgen_composite_type.go",
        "opgen_composite_type_attr_name.go",
        "opgen_composite_type_attr_type.go",
        "opgen_constraint_comment.go",
        "opgen_constraint_name.go",
        "opgen_database.go",
        "opgen_database_comment.go",
        "opgen_database_data.go",
        "opgen_database_region_config.go",
        "opgen_database_role_setting.go",
        "opgen_database_zone_config.go",
        "opgen_enum_type.go",
        "opgen_enum_type_value.go",
        "opgen_foreign_key_constraint.go",
        "opgen_foreign_key_constraint_unvalidated.go",
        "opgen_function.go",
        "opgen_function_body.go",
        "opgen_function_leakproof.go",
        "opgen_function_name.go",
        "opgen_function_null_input.go",
        "opgen_function_security.go",
        "opgen_function_volatility.go",
        "opgen_index_column.go",
        "opgen_index_comment.go",
        "opgen_index_data.go",
        "opgen_index_name.go",
        "opgen_index_partitioning.go",
        "opgen_index_zone_config.go",
        "opgen_namespace.go",
        "opgen_owner.go",
        "opgen_primary_index.go",
        "opgen_row_level_ttl.go",
        "opgen_schema.go",
        "opgen_schema_child.go",
        "opgen_schema_comment.go",
        "opgen_schema_parent.go",
        "opgen_secondary_index.go",
        "opgen_secondary_index_partial.go",
        "opgen_sequence.go",
        "opgen_sequence_option.go",
        "opgen_sequence_owner.go",
        "opgen_table.go",
        "opgen_table_comment.go",
        "opgen_table_data.go",
        "opgen_table_locality_global.go",
        "opgen_table_locality_primary_region.go",
        "opgen_table_locality_regional_by_row.go",
        "opgen_table_locality_secondary_region.go",
        "opgen_table_partitioning.go",
        "opgen_table_schema_locked.go",
        "opgen_table_zone_config.go",
        "opgen_temporary_index.go",
        "opgen_type_comment.go",
        "opgen_unique_without_index_constraint.go",
        "opgen_unique_without_index_constraint_unvalidated.go",
        "opgen_user_privileges.go",
        "opgen_view.go",
        "register.go",
        "specs.go",
        "target.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/schemachanger/scplan/internal/opgen",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/clusterversion",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/schemachanger/rel",
        "//pkg/sql/schemachanger/scop",
        "//pkg/sql/schemachanger/scpb",
        "//pkg/sql/schemachanger/scplan/internal/scgraph",
        "//pkg/sql/schemachanger/screl",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/util/iterutil",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "opgen_test",
    size = "small",
    srcs = ["register_test.go"],
    embed = [":opgen"],
    deps = ["//pkg/sql/schemachanger/scpb"],
)
